package com.junzhiit.nengji.cms.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.junzhiit.nengji.cms.service.ChainInfoService;
import com.junzhiit.nengji.cms.web.vo.ChainInfoVO;
import com.junzhiit.nengji.cms.web.vo.ResultVO;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value="chain/info")
public class ChainInfoController {
	
	@Autowired
	ChainInfoService chainInfoService;
	
	@ApiOperation(value="查询品牌商业信息")
	@RequestMapping(method=RequestMethod.GET)
	public ResultVO findChainInfoBySessionId(String sessionId){
		return chainInfoService.findChainInfoBySessionId(sessionId);
	}
	
	@ApiOperation(value="删除照片")
	@RequestMapping(method=RequestMethod.DELETE)
	public ResultVO delImg(Integer imgType,String chainInfoId){
		return chainInfoService.delImg(imgType, chainInfoId);
	}
	
	@ApiOperation(value="更新品牌商业信息")
	@RequestMapping(method=RequestMethod.PUT)
	public ResultVO updateChainInfo(ChainInfoVO chainInfoVO){
		return chainInfoService.updateChainInfo(chainInfoVO);
	}
}
